<template>
  <div class="header">
    <div class="header_left">
      <span class="iconfont back_icon">&#xe624;</span>
    </div>
    <div class="header_input">
      <span class="iconfont">&#xe632;</span>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header_right" >
        {{this.city}}
        <span class="iconfont arrow_icon">&#xe6aa;</span>
      </div>
    </router-link>
    <div style="clear: both"></div>
  </div>

</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])/*mapState的意思是把公用数据city映射到名字叫city的计算属性中*/
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .header
    display: flex
    height: $headerHeight
    line-height: $headerHeight
    background: $bjColor
    color: #fff
    .header_left
      float: left
      width: .64rem
      text-align: center
      .back_icon
        font-size: .4rem
    .header_input
      flex: 1
      width: 100%;
      border-radius: .06rem
      margin: .12rem 0 0 .2rem
      background: white
      padding-left: .2rem
      height: .6rem
      line-height: .6rem
      color: #ccc
    .header_right
      float: right
      padding: 0 0.18rem;
      min-width: 1rem
      text-align: center
      color: #fff
      .arrow_icon
        font-size: .24rem
        margin-left: -.04rem
</style>
